

package com.xgit.iov.common.core.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 部门管理
 * </p>
 *
 * @author lengleng
 * @since 2019/2/1
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysDept extends TenantEntity {

	private static final long serialVersionUID = 1L;

	/**
	 * 父级部门id
	 */
	@ApiModelProperty(value = "父级部门id")
	@JsonSerialize(using= ToStringSerializer.class)
	private Long parentId;

	/**
	 * 祖先部门id
	 */
	@ApiModelProperty(value = "祖先部门id")
	private String parentIds;

	/**
	 * 部门名称
	 */
	@NotBlank(message = "部门名称不能为空")
	@ApiModelProperty(value = "部门名称")
	private String name;

	/**
	 * 部门编码
	 */
//	@NotBlank(message = "部门编码不能为空")
	@ApiModelProperty(value = "部门编码")
	private String code;

	/** 联系人 */
	@ApiModelProperty(value="租户名称",name="linkman")
	private String linkman;


	/** 联系电话 */
	@ApiModelProperty(value="租户名称",name="contact")
	private String contact;


	/** 联系地址 */
	@ApiModelProperty(value="租户名称",name="address")
	private String address;

	/**
	 * 排序
	 */
	@ApiModelProperty(value = "排序值")
	private Integer sort;

	/**
	 * 是否是懒加载
	 */
	@TableField(exist = false)
	private  boolean lazy;

	/**
	 * 是否有子孙节点
	 */
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private Boolean hasChildren;

}
